package com.dibang.app.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.dibang.app.MainActivity;
import com.dibang.app.R;
import com.hanks.htextview.base.AnimationListener;
import com.hanks.htextview.base.HTextView;
import com.hanks.htextview.fade.FadeTextView;

/**
 * Created by wxl on 2019/7/25.
 */

public class StartActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.start_layout);
        FadeTextView typerTextView = findViewById(R.id.start_typer_text_view);
        typerTextView.setAnimationDuration(3000);
        typerTextView.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationEnd(HTextView hTextView) {
                Intent intent = new Intent(StartActivity.this, MainActivity.class);
                startActivity(intent);
                finish();
            }
        });
        FadeTextView lineTextView = findViewById(R.id.start_rainbow_text_view);
        lineTextView.animateText("鸣哇科技");
        lineTextView.setAnimationListener(new AnimationListener() {
            @Override
            public void onAnimationEnd(HTextView hTextView) {
                typerTextView.animateText("伴您一路前行");
            }
        });
    }
}
